<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./templates/template_general.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml">
    <body>

        <ui:define name="title">
            Inscription
        </ui:define>

        <ui:define name="content">
            <div class="profil_user">
                <p:panel header="Mon profil" style="text-align:center;width: 100%">
                    <h:form>
                        <p:messages showDetail="true" id="log" globalOnly="true" autoUpdate="false"/>
                        <h:panelGrid id="panelgrid_user_info" styleClass="panelgrid_user_info" columns="2" style="width:100%;">

                            <h:outputLabel value="Login :"/>
                            <p:inputText size="30" id="login" title="login" value="#{login}"/>

                            <h:outputLabel value="Mot de passe :"/>
                            <p:inputText size="30" type="password" id="motDePasse" title="motDePasse" value="#{mdp}"/>

                            <h:outputLabel value="Nom :"/>
                            <p:inputText size="30" id="nom" title="nom" value="#{nom}"/>

                            <h:outputLabel value="Prénom :"/>
                            <p:inputText size="30" id="prenom" title="prenom" value="#{prenom}"/>

                            <h:outputLabel value="Email :"/>
                            <p:inputText size="30" id="email" title="email" value="#{email}"/>

                            <h:outputLabel value="Téléphone :"/>
                            <p:inputText size="30" id="telephone" title="telephone" value="#{telephone}"/>

                            <h:outputLabel value="Type :"/>
                            <p:panel style="width: 170px;">
                                <h:selectBooleanCheckbox id="typeUtilisateur" title="typeUtilisateur" value="#{typeUtilisateur}"/>
                                <h:outputLabel value="Commercant" for="typeUtilisateur"/>
                            </p:panel>

                        </h:panelGrid>
                        <p:commandButton id="inscrire" update="log" value="S'inscrire" action="#{utilisateurMBean.creerUtilisateur(login, mdp, nom, prenom, email, telephone, typeUtilisateur)}"/>
                    </h:form>
                </p:panel>
            </div>
        </ui:define>
    </body> 
</ui:composition>
